package com.kitty.game.confirm.service.handler;

import com.kitty.common.utils.SpringUtils;
import com.kitty.game.confirm.model.AddFriendConfirm;
import com.kitty.game.role.model.Role;
import com.kitty.game.team.message.ReqConfirmResult;
import org.springframework.stereotype.Component;

@Component
public class AddFriendConfirmHandler extends ConfirmHandler {
    @Override
    public void handleConfirmResult(Role role, ReqConfirmResult reqConfirmResult) {
        if ("1".equals(reqConfirmResult.getSelect())) {
            AddFriendConfirm addFriendConfirm = (AddFriendConfirm)role.getConfirm();
            SpringUtils.getFriendService().confirmAddFriend(role, addFriendConfirm.getTarget());
        }
    }
}
